﻿using System.Configuration;
using System.Data;
using System.Windows;

namespace StorageApp
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : System.Windows.Application
    {
        private System.Threading.Mutex? mutex;
        public App()
        {
            this.Startup += new StartupEventHandler(App_Startup);

        }
        private void App_Startup(object sender, StartupEventArgs e)
        {
            bool ret;
            mutex = new System.Threading.Mutex(true, "name", out ret);

            if (!ret)
            {
                System.Windows.MessageBox.Show("程序已打开", "", MessageBoxButton.OK, MessageBoxImage.Stop);
                Environment.Exit(0);
            }
        }
    }

}
